package com.harmontronics.hanma.paas.paas.domain.organization.service;

import com.harmontronics.hanma.paas.paas.common.MosResponse;
import com.harmontronics.hanma.paas.paas.common.PageBase;
import com.harmontronics.hanma.paas.paas.domain.organization.entity.SsoOrgResult;
import com.harmontronics.hanma.paas.paas.domain.organization.entity.SsoOrgTreeDtoResult;
import com.harmontronics.hanma.paas.paas.domain.organization.entity.SsoSubmitUserResult;
import com.harmontronics.hanma.paas.paas.domain.organization.entity.SsoUserDtoResult;
import com.harmontronics.hanma.paas.paas.domain.organization.entity.SsoUserResult;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "mos", url = "${mos.oss.domain}")
public interface MosService {

    /**
     * mos系统用户相关接口
     *
     *
     */
    @GetMapping("/api/user/mock-getUserById")
    SsoUserResult mockGetUserById(@RequestParam("userId") Long userId);

    @GetMapping("/api/user/get-by-token")
    MosResponse<SsoUserResult> getUserInfo(@RequestParam("appTag") String appTag);

    @GetMapping("/api/user")
    MosResponse<SsoUserDtoResult> getUserById(@RequestParam("id") Long id);

    @GetMapping("/api/user/search")
    MosResponse<PageBase<SsoUserResult>> searchUser(@RequestParam("searchKey") String searchKey,
            @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize);

    @GetMapping("/api/user/list")
    MosResponse<PageBase<SsoUserDtoResult>> getPageUserwithParams(@RequestParam int pageNo,
            @RequestParam int pageSize,
            @RequestParam(required = false) Long id,
            @RequestParam(required = false, defaultValue = "") String name,
            @RequestParam(required = false) String jobNumber,
            @RequestParam(required = false) String telephone,
            @RequestParam(required = false) Integer status,
            @RequestParam(required = false) String userName,
            @RequestParam(required = false) String email);

    @GetMapping("/api/user/all")
    MosResponse<SsoUserDtoResult> getAllUser();

    @GetMapping("/api/user/list/idsStr")
    MosResponse<List<SsoUserDtoResult>> listByIds(@RequestParam("ids") String ids);

    @GetMapping("/api/user/submit-user")
    MosResponse<List<SsoSubmitUserResult>> getSubmitUser(@RequestParam("submitterIds") String submitterIds);

    @GetMapping("/api/user/user-manageOrg")
    MosResponse<List<SsoUserResult>> findUserByOrgId(@RequestParam("orgId") Long orgId);


    /**
     * mos系统组织机构相关接口
     *
     *
     */

    @GetMapping("/api/org/mock-getById")
    MosResponse<SsoOrgResult> getOrgById(@RequestParam("id") Long id);

    @GetMapping("/api/org/all")
    MosResponse<List<SsoOrgResult>> getAllOrg();

    @GetMapping("/api/org/mock-getChildrenIds")
    MosResponse<List<Long>> getChildrenIds(@RequestParam("orgId") Long orgId);

    @GetMapping("/api/org/mock-getParentIds")
    List<Long> getParentOrgIds(@RequestParam("userId") Long userId);

    @GetMapping("/api/org/mock-userBelongTo")
    MosResponse<List<Long>> mockUserBelongTo(@RequestParam("orgIds") String orgIds,@RequestParam("userId") Long userId);

    @GetMapping("/api/org/mock-rootOrg")
    SsoOrgResult getRootOrg();

    @GetMapping("/api/org/mock-getOrdByOrgIds")
    List<SsoOrgResult> getOrgByOrgIds(@RequestParam("orgId") String orgIds);


    /**
     * mos系统用户组织机构相关接口
     *
     *
     */
    @GetMapping("/api/userOrg/userByOrgIds")
    Boolean existUserByOrgIds(@RequestParam("orgIds") String orgIds);

    @GetMapping("/api/userOrg/orgByUserId")
    MosResponse<List<SsoOrgTreeDtoResult>> getOrgByUserId(@RequestParam("userId") Long userId);



}
